import {Ajax} from '../utils/request'

const getOrders = () => Ajax.get("/api/orders/preview")

const submitOrders = (data) => Ajax.post("/api/orders",data)

const getOrdersList = (orderId,data) => Ajax.get(`/api/orders/${orderId}`,data)

const getOrderList = (data = {}) => Ajax.get(`/api/orders?include=orderDetails.goods`, data, false)

const getConfirmOrder = (orderId) => Ajax.patch(`/api/orders/${orderId}/confirm`)

const addEvaluation = (orderId,data) => Ajax.post(`/api/orders/${orderId}/comment`,data)

export {
    getOrders,
    submitOrders,
    getOrdersList,
    getOrderList,
    getConfirmOrder,
    addEvaluation
}